package com.dy.course.enumerate;

public enum UserType  implements Codable{

	TEACHER(1, "老师"), STUDENT(2, "学生"), OTHER(3, "其他");

	private Integer code;
	private String desc;

	private UserType(Integer code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public Integer getCode() {
		return this.code;
	}

	public String getDesc() {
		return this.desc;
	}

	public boolean isCorrent(Integer code) {
		UserType[] mses = UserType.values();
		for (UserType ms : mses) {
			if (ms.getCode() == code) {
				return true;
			}
		}
		return false;
	}
}
